<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<!--引入vue-->
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<div id="app">
  <cpn></cpn>
  <cpn></cpn>
  <cpn ref="reference属性"></cpn>
  <button @click="btnClick">按钮</button>
</div>
<template id="cpn">
  <div>我是子组件</div>
</template>
<script>
  const app = new Vue({
    el: "#app",
    data:{
      message:"Hello zk I am Vue !"
    },
    methods:{
      btnClick(){

        console.log(this.$refs)
      }
    },
    components:{
      cpn:{
        template:'#cpn',
        data(){
          return{
            name:'我是子组件的name'
          }
        },
        methods:{
          showMessage(){
            console.log("showMessage");
          }
        }
      }
    }
  })
</script>
</body>
</html>
